//
//  MyTableViewCell.m
//  LastTemp
//
//  Created by dllo on 15/4/24.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "MyTableViewCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation MyTableViewCell
- (void)dealloc
{
    [_listenImageView release];
    [_myImageView release];
    [_nameLabel release];
    [_wordLabel release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
       
        self.myView = [[UIView alloc] init];
        [self.contentView addSubview:self.myView];
        [_myView release];
        
        self.myImageView = [[UIImageView alloc] init];
        [self.myView addSubview:self.myImageView];
        [_myImageView release];
        
        self.listenImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.listenImageView];
        [_listenImageView release];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.nameLabel];
        [_nameLabel release];
        
        self.wordLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.wordLabel];
        [_wordLabel release];
        self.contentView.backgroundColor = [UIColor clearColor];
        
        
        
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.myView.frame = CGRectMake(10, 5, 60, 60);
    self.myView.backgroundColor = [UIColor blackColor];
    self.myView.layer.cornerRadius = 30;
    self.myImageView.frame = CGRectMake(0, 0, 60, 60);
    self.myImageView.layer.cornerRadius = 30;
    self.myImageView.clipsToBounds = YES; // 出框
    self.myImageView.contentMode = UIViewContentModeScaleAspectFill; //设置出框效果

    self.listenImageView.frame = CGRectMake(WIDTH-40, 10, 30, 30);
    self.nameLabel.frame = CGRectMake(80, 10, WIDTH-100, 25);
    self.wordLabel.frame = CGRectMake(80, 40, WIDTH-100, 25);
    self.wordLabel.font = [UIFont systemFontOfSize:12];
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
